home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
8bitfiles.net/archives
/
archives.tar
/
archives
/
commodore-users-of-norman
/
CUON_26_(10-1984).d64
/
string search 2
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2019-04-13
|
806b
|
36 lines
20 A$="DUMMY DATA":REM MUST BE A STRING
30 Q$="":REM THIS IS TO BE USED AS THE SEARCH STRING
40 DIMA$(300),Q%(300):REM SEARCHED STRING AND FLAG ARRAY
45 ML=PEEK(55)+256*PEEK(56):REM START ADDRESS
100 PRINT"BUILDING ARRAY"
110 Q$="GOOD"
120 FORL=1TO299
130 :
140 :A$(L)="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
150 :
160 NEXTL
170 A$(1)="GARBAGE GOOD MORE GARBAGE"
180 A$(10)="GARB GOOD MORE GARB"
185 A$(70)="GOOD GARBAGE"
190 A$(100)="GARBAGE GOOD"
195 A$(250)="GARBAGE GOOD MORE GARBAGE"
200 PRINT"ARRAY FINISHED"
300 REM BASIC SEARCH
310 PRINT"BASIC SEARCH":TI$="000000"
320 FORL=1TO299
330 :FORJ=1TOLEN(A$(L))-LEN(Q$)+1
340 ::IFMID$(A$(L),J,LEN(Q$))=Q$THENQ%(L)=1:NEXTL
350 :NEXTJ
360 NEXTL
370 PRINTTI;"JIFFIES"
380 FORL=1TO299
390 :IFQ%(L)<>0THENPRINTA$(L)
395 NEXTL
400 REM ML SEARCH
410 PRINT"ML SEARCH":TI$="000000"
420 SYS(ML)
430 PRINTTI;"JIFFIES"
440 FORL=1TO299
450 :IFQ%(L)<>0THENPRINTA$(L)
460 NEXTL